__author__ = 'el_even'

import path
import generator


alias = {'pagecreate': ':Create New Account',
         'pagethanks': ':Thank you',
         'flat': 'flat registration form',
         's_account': 'pentondev,pentonpisces',
         'newsletters': 'BEEF-05', # newsletters list
         'regcompletethanks': 'registration complete - thank you',
         'eVar46': 'D=prop46',
         'forum': 'forum', #eVar2 properties
         'comment': 'comment',
         'nav': 'nav',
         'email': 'email',
         'print': 'print',
         'gated': 'gate',
         'download': 'download'}

# the headers in omniture requests
omniheaders = {'c46': 'prop46',
               'v69': 'eVar69',
               'v2': 'eVar2',   #check
               'v33': 'eVar33',   #check
               'v10': 'eVar10',   #check
               'v1': 'eVar1',   #check
               'v46': 'eVar46',
               'pageName': 'pageName'}

# the values for corresponding omniture variables

common = {'eVar46': alias['eVar46'],
          'eVar69': alias['s_account']}

common_flat = {'eVar46': alias['eVar46'],
               'pageName': alias['pagecreate'],
               'prop46': alias['flat'],
               'eVar69': alias['s_account']}

common_regged = {'eVar46': alias['eVar46'],
                 'eVar1': alias['newsletters'],
                 'eVar10': generator.name,
                 'pageName': alias['pagethanks'],
                 'prop46': alias['regcompletethanks'],
                 'eVar69': alias['s_account']}


forumspec = {'eVar2': alias['forum'],
             'pageName': path.penton.get('forumtitle')}
forumspec_flat = {'eVar2': alias['forum']}
forumspec_regged = {'eVar2': alias['forum']}
forum = common.copy()
forum.update(forumspec)
forum_flat = common_flat.copy()
forum_flat.update(forumspec_flat)
forum_regged = common_regged.copy()
forum_regged.update(forumspec_regged)


commentspec = {'eVar2': alias['comment'],
               'pageName': path.penton.get('commenttitle')}
commentspec_flat = {'eVar2': alias['comment']}
commentspec_regged = {'eVar2': alias['comment']}
comment = common.copy()
comment.update(commentspec)
comment_flat = common_flat.copy()
comment_flat.update(commentspec_flat)
comment_regged = common_regged.copy()
comment_regged.update(commentspec_regged)


navspec = {'eVar2': alias['nav'],
           'pageName': path.penton.get('navtitle')}
navspec_flat = {'eVar2': alias['nav']}
navspec_regged = {'eVar2': alias['nav']}
nav = common.copy()
nav.update(navspec)
nav_flat = common_flat.copy()
nav_flat.update(navspec_flat)
nav_regged = common_regged.copy()
nav_regged.update(navspec_regged)


emailspec = {'eVar2': alias['email'],
             'pageName': path.penton.get('emailtitle')}
emailspec_flat = {'eVar2': alias['email']}
emailspec_regged = {'eVar2': alias['email']}
email = common.copy()
email.update(emailspec)
email_flat = common_flat.copy()
email_flat.update(emailspec_flat)
email_regged = common_regged.copy()
email_regged.update(emailspec_regged)


printspec = {'eVar2': alias['print'],
             'pageName': path.penton.get('printtitle')}
printspec_flat = {'eVar2': alias['print']}
printspec_regged = {'eVar2': alias['print']}
prnt = common.copy()
prnt.update(printspec)
print_flat = common_flat.copy()
print_flat.update(printspec_flat)
print_regged = common_regged.copy()
print_regged.update(printspec_regged)


gatedspec = {'eVar2': alias['gated'],
             'pageName': path.penton.get('gatedtitle')}
gatedspec_flat = {'eVar2': alias['gated']}
gatedspec_regged = {'eVar2': alias['gated']}
gated = common.copy()
gated.update(gatedspec)
gated_flat = common_flat.copy()
gated_flat.update(gatedspec_flat)
gated_regged = common_regged.copy()
gated_regged.update(gatedspec_regged)


downloadspec = {'eVar2': alias['download'],
                'pageName': path.penton.get('downloadtitle')}
downloadspec_flat = {'eVar2': alias['download']}
downloadspec_regged = {'eVar2': alias['download']}
download = common.copy()
download.update(downloadspec)
download_flat = common_flat.copy()
download_flat.update(downloadspec_flat)
download_regged = common_regged.copy()
download_regged.update(downloadspec_regged)


# the hack to nest lists
mode = {'forum': forum,
        'forum_flat': forum_flat,
        'forum_regged': forum_regged,
        'comment': comment,
        'comment_flat': comment_flat,
        'comment_regged': comment_regged,
        'nav': nav,
        'nav_flat': nav_flat,
        'nav_regged': nav_regged,
        'email': email,
        'email_flat': email_flat,
        'email_regged': email_regged,
        'print': prnt,
        'print_flat': print_flat,
        'print_regged': print_regged,
        'gated': gated,
        'gated_flat': gated_flat,
        'gated_regged': gated_regged,
        'download': download,
        'download_flat': download_flat,
        'download_regged': download_regged}

